import { publicKey } from '@/utils/config';

export const doSm3AndSm2Encrypt = (sourceStr) => {
    // eslint-disable-next-line no-undef
    const sm2Utils = new Sm2Utils();
    // eslint-disable-next-line no-undef
    const sm3_random_plain = Sm3Utils.encryptFromText(sourceStr) + '|' + sm2Utils.randomWord(8) + '|' + sourceStr;
    // eslint-disable-next-line no-undef
    const sm3_sm2_plain = sm2Utils.encryptFromText(publicKey, sm3_random_plain)
    return '{crypto}' + sm3_sm2_plain;
}